package com.ruoyi.logCen.dKafka;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/testCon/dkafka")
public class StartOrStopListenerController {

    @Autowired
    KafkaListenerService kafkaListenerService;

    @GetMapping("/start")
    public void start(@RequestParam("id") String listenerId) {
        kafkaListenerService.startListener(listenerId);
    }

    @GetMapping("/stop")
    public void stop(@RequestParam("id") String listenerId) {
        kafkaListenerService.stopListener(listenerId);
    }
}
